package com.smile.service.entity.device.property;

import com.alibaba.fastjson2.annotation.JSONField;
import lombok.Data;
import lombok.ToString;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

@Data
@ToString
public class DockStatusMessage implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 机场累计作业次数
     */
    @JSONField(alternateNames = "job_number")
    private Integer jobNumber;

    /**
     * 机场累计运行时长
     */
    @JSONField(alternateNames = "acc_time")
    private Long accTime;

    /**
     * 机场激活时间(unix 时间戳)
     */
    @JSONField(alternateNames = "activation_time")
    private Long activationTime;

    /**
     * 保养信息
     */
    @JSONField(alternateNames = "maintain_status")
    private MaintainStatus maintainStatus;

    /**
     * 保养信息
     */
    @Data
    @ToString
    class MaintainStatus {

        /**
         * 保养信息数组
         */
        @JSONField(alternateNames = "maintain_status_array")
        private List<MaintainStatusData> maintainStatusArray;

        @Data
        @ToString
        class MaintainStatusData {

            /**
             * 保养状态
             */
            @JSONField(alternateNames = "state")
            private Integer state;

            /**
             * 上一次保养类型
             */
            @JSONField(alternateNames = "last_maintain_type")
            private Integer lastMaintainType;

            /**
             * 上一次保养时间
             */
            @JSONField(alternateNames = "last_maintain_time")
            private Integer lastMaintainTime;

            /**
             * 上一次保养时作业架次
             */
            @JSONField(alternateNames = "last_maintain_work_sorties")
            private Integer lastMaintainWorkSorties;

        }
    }

    /**
     * 市电电压
     */
    @JSONField(alternateNames = "electric_supply_voltage")
    private Long electricSupplyVoltage;

    /**
     * 工作电压
     */
    @JSONField(alternateNames = "working_voltage")
    private Long workingVoltage;

    /**
     * 工作电流
     */
    @JSONField(alternateNames = "working_current")
    private Long workingCurrent;

    /**
     * 机场备用电池信息
     */
    @JSONField(alternateNames = "backup_battery")
    private BackupBattery backupBattery;

    @Data
    @ToString
    class BackupBattery {

        /**
         * 备用电池电压
         */
        @JSONField(alternateNames = "voltage")
        private Long voltage;

        /**
         * 备用电池温度
         */
        @JSONField(alternateNames = "temperature")
        private BigDecimal temperature;

        /**
         * 备用电池开关
         */
        @JSONField(alternateNames = "switch")
        private Integer switchStatus;
    }

    /**
     * 飞行器电池保养信息
     */
    @JSONField(alternateNames = "drone_battery_maintenance_info")
    private DroneBatteryMaintenanceInfo droneBatteryMaintenanceInfo;

    @Data
    @ToString
    class DroneBatteryMaintenanceInfo {

        /**
         * 保养状态
         */
        @JSONField(alternateNames = "maintenance_state")
        private Integer maintenanceState;

        /**
         * 电池保养剩余时间
         */
        @JSONField(alternateNames = "maintenance_time_left")
        private Long maintenanceTimeLeft;

    }

}
